import Vue from 'vue'
// 2018年07月01日 作者:827879040@qq.com vue全局过滤器
Vue.filter('sum', function (value) {
  if (value === 'pc_zfb') {
    return '支付宝支付'
  }
  if (value === 'pc_wx') {
    return '微信支付'
  }
})
Vue.filter('checkSrc', function (value) {
  console.log(value)
  return value
})
Vue.filter('timeFormatting', function (value) {
  if (!value) return false
  let currentData = Number(value)
  let now = new Date(currentData)
  let year = now.getFullYear()
  let month = now.getMonth() + 1
  let date = now.getDate()
  let hour = now.getHours()
  let minute = now.getMinutes()
  let second = now.getSeconds()
  let currentTime = year + '-' + month + '-' + date + ' ' + hour + ':' + minute + ':' + second
  return currentTime
})
Vue.filter('monthFormatting', function (value) {
  if (!value) return false
  let currentData = Number(value)
  let now = new Date(currentData)
  let year = now.getFullYear()
  let month = now.getMonth() + 1
  let date = now.getDate()
  let hour = now.getHours()
  let minute = now.getMinutes()
  let second = now.getSeconds()
  let currentTime = month + '-' + date + ' ' + hour + ':' + minute
  return currentTime
})
